package com.secxiot.provider.communication.dao;

import com.secxiot.provider.communication.entity.Communication;
import com.secxiot.provider.communication.entity.CommunicationExample;
import com.secxiot.provider.communication.vo.*;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface CommunicationDao {
	int countByExample(CommunicationExample example);

	int deleteByExample(CommunicationExample example);

	int deleteByPrimaryKey(Long id);

	int insert(Communication record);

	Long insertSelective(Communication record);

	List<Communication> selectByExample(CommunicationExample example);

	Communication selectByPrimaryKey(Long id);

	int updateByExampleSelective(@Param("record") Communication record, @Param("example") CommunicationExample example);

	int updateByExample(@Param("record") Communication record, @Param("example") CommunicationExample example);

	int updateByPrimaryKeySelective(Communication record);

	int updateByPrimaryKey(Communication record);

	List<CommunicatePatientVo> getPatientList(@Param("deptId") Long deptId, @Param("userId") Long userId,
			@Param("userType") String userType, @Param("patientName") String patientName, @Param("pageNo") Long pageNo,
			@Param("pageSize") Long pageSize);

	List<CommunicatePatientVo> getReadInfoOfDoctor(@Param("doctorId") Long doctorId,
			@Param("patientId") Long patientId);

	List<CommunicateDoctorVo> getDoctorList(@Param("patientId") Long patientId, @Param("doctorName") String doctorName,
			@Param("pageNo") Long pageNo, @Param("pageSize") Long pageSize);

	List<CommunicateDoctorVo> getReadInfoOfPatient(@Param("patientId") Long patientId,
			@Param("doctorId") Long doctorId);

	/**
	 * 获取 除医生/患者 外的其他主题列表
	 * @param map
	 * @return
	 */
	List<CommunicationVo> getCommunicationListOfOther(Map<String, Object> map);

	/**
	 * 医生/患者主题列表
	 * @param map
	 * @return
	 */
	List<CommunicationVo> getCommunicationListOfDocAndPa(Map<String, Object> map);

	void deleteByCommunicationId(@Param("communicationId") Long communicationId);

    CommunicationUnreadCount getUnreadCount(@Param("readUserId")Long readUserId, @Param("userType")String userType);

	List<CommunicationTalkVo> getcommunicationTalklist(Long talkUserId, Long userId, long pageNo, Long pageSize);

	Long sendTalkMessage(Long talkUserId, Long user, String content, Integer contentType);
}